const path = require('path');
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
    entry: './src/main.js',
    output: {
        path: path.resolve(__dirname, './dist'),
        filename: 'bundle.js',
    },
    module: {
        rules: [{
            test: /\.vue$/,
            include: /src/,
            use: [{
                loader: 'vue-loader',
            }]
        }, {
            test: /\.html$/,
            include: /src/,
            use: [{
                loader: 'html-loader',
                // options: {
                //     attrs: ['img:src']
                // }
            }]
        }, {
            test: /\.css$/,
            include: /src/,
            use: ['style-loader', 'css-loader']
        }, {
            test: /\.less$/,
            include: /src/,
            use: ['style-loader', 'css-loader', 'less-loader']
        }, {
            test: /\.png$/,
            include: /src/,
            use: [{
                loader: 'url-loader',
                options: {
                    esModule: false,
                }
            }]
        }]
    },
    plugins: [
        new VueLoaderPlugin(),
        new HtmlWebpackPlugin({
            template: './public/index.html',
            favicon: './public/favicon.ico'
        }),
    ]
}